package com.bbm.service.impl;


import com.bbm.entity.HouseProperty;
import com.bbm.entity.Property;
import com.bbm.entity.vo.ResponseResult;
import com.bbm.mapper.HousePropertyMapper;
import com.bbm.mapper.PropertyMapper;
import com.bbm.service.HousePropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * (HouseProperty)表服务实现类
 *
 * @author lionkliu
 * @since 2024-02-20 21:42:21
 */
@Service("housePropertyService")
public class HousePropertyServiceImpl implements HousePropertyService {

    @Autowired
    private HousePropertyMapper housePropertyMapper;
    @Autowired
    private PropertyMapper propertyMapper;

    @Override
    public ResponseResult getPropertyByHouseId(Integer id) {
        List<HouseProperty> houseProperties = housePropertyMapper.getPropertyByHouseId(id);
        //List<List<Property>> collect = houseProperties.stream()
        //        .forEach(houseProperty -> {
        //                    Property property = propertyMapper.getPropertiesById(houseProperty.getPropertyId());
        //                    return property;
        //                }
        //        )
        //        .collect(Collectors.toList());
        return ResponseResult.okResult();
    }
}

